#include<stdio.h>
int main()
{
	int n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		int num;
		scanf("%d",&num);
		if(num%2!=0)
		printf("%d has no even factors\n",num);
		else
		{
		 	for(i=1;i<=num;i++)
			{
				if(num%i==0)
				{
					if(i%2==0)
						printf("%d ",i); 
				}
			}
			printf("\n");
		} 
	}
}
